home *** CD-ROM | disk | FTP | other *** search
- Path: news.aros.net!kwalker
- From: kwalker@aros.net (Knight Walker)
- Newsgroups: comp.lang.c
- Subject: Re: fclose() and remove() within a funct'n
- Date: 25 Feb 1996 11:54:49 GMT
- Organization: ArosNet Inc.
- Message-ID: <4gpime$8on@news.aros.net>
- References: <4fo8ps$3v6@milo.freenet.vancouver.bc.ca>
- NNTP-Posting-Host: terra.aros.net
- X-Newsreader: TIN [version 1.2 PL2]
-
- Patrick Wong (zipz@opus.freenet.vancouver.bc.ca) wrote:
- : I'm writing a function that is supposed to close and remove temporary files
- : on a DOS machine. I'm posting this in c.l.c because it's a C question as
- : well as a DOS question.
- : I am using the atexit() function to close the temporary file before
- : exiting the function. Yet the atexit() function will not allow me to
- : pass a pointer to the file that I want to close (and delete). The
- : function MUST be responsible for closing and deleting all temporary files
- : it creates upon PROGRAM termination (hence the atexit() function).
-
- Well, the problem is that atexit() registers functions that take no
- arguments (e.g. quit(void)). It doesn't allow function arguments to be
- passed (Because the functions are called in an interrupt form, and you
- can't control how they're called).
-